//
//  MYXReleaseTopView.m
//  meiyinxiang
//
//  Created by lizidi on 2018/1/8.
//  Copyright © 2018年 hbjApple. All rights reserved.
//

#import "MYXReleaseTopView.h"

@implementation MYXReleaseTopView

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        //创建视图
        [self createView];
    }
    return self;
    
}

-(void)createView{
    
    float imgX = [MyAdapter laDapter:5];
    float imgW = self.bounds.size.width - imgX * 2;
    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(imgX, 0, imgW, imgW)];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.font = [MyAdapter lfontADapter:18];
    _titleLabel.textColor = [UIColor whiteColor];
    [self addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset([MyAdapter laDapter:5]);
        make.top.offset(0);
        make.height.offset([MyAdapter laDapter:30]);
    }];
    _numLabel = [[UILabel alloc] init];
    _numLabel.textAlignment = NSTextAlignmentCenter;
    _numLabel.font = [MyAdapter lfontADapter:14];
    _numLabel.textColor = [UIColor whiteColor];
    [self addSubview:_numLabel];
    [_numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(_titleLabel).offset(0);
        make.top.equalTo(_titleLabel.mas_bottom).offset([MyAdapter laDapter:5]);
    }];
}

-(void)configDataWithTitle:(NSString *)title Num:(NSString *)Num
{
    _titleLabel.text = title;
    _numLabel.text = Num;
}

/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */

@end

